package com.yxh.lib_base.ext.databinding

import android.view.View
import androidx.databinding.BindingAdapter
import com.yxh.lib_base.ext.view.clickNoRepeat

/**
 * @作者：yuan_xh
 * @时间：2022/8/24 7:19
 * @描述：
 **/
object DataBindIngAdapterCommon {

    @JvmStatic
    @BindingAdapter(value = ["clickNoRepeat"])
    fun setOnClickNoRepeat(view : View, clickNoRepeat: () -> Unit){
        view.clickNoRepeat {
            clickNoRepeat.invoke()
        }
    }

    @JvmStatic
    @BindingAdapter("setOnClickRepeatListener")
    fun setOnClickRepeatListener(view: View,onClickListener: View.OnClickListener){
        view.clickNoRepeat { onClickListener.onClick(it) }
    }


}